@extends('home.frame')
@section('content')
<link href="/ho/css/infstyle.css" rel="stylesheet" type="text/css">
<link href="/ho/css/personal.css" rel="stylesheet" type="text/css">
<!--标题 -->
<div class="user-safety">
	<div class="am-cf am-padding">
		<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">账户安全</strong> / <small>Set&nbsp;up&nbsp;Safety</small></div>
	</div>
	<hr/>

	<!--头像 -->
	<div class="user-infoPic">

		<div class="filePic">
			<img class="am-circle am-img-thumbnail" src="/ho/images/getAvatar.do.jpg" alt="" />
		</div>

		<div class="info-m">
			<div><b>用户名：<i>{{$user->uname}}</i></b></div>
			<div class="u-level">
				<span class="rank r2">
		             <s class="vip1"></s><a class="classes" href="#">会员等级：{{$userinfo->uf_vstatus}}</a>
	            </span>
			</div>
			<div class="u-level">
				<span class="rank r2">
		             <s class="vip1"></s><a class="classes" href="#">积分：{{$userinfo->ufscore}}</a>
	            </span>
			</div>
		</div>
	</div>

	<div class="check">
						@if(is_object($errors) && count($errors) > 0)
						  <div style="color:red;" class="one" onclick="$(this).css('display','none')">
						    验证失败：
						      <ul>
						          @foreach ($errors->all() as $error)
						              <li>{{ $error }}</li>
						          @endforeach
						      </ul>
						  </div>
						@elseif(is_string($errors))
						<div style="color:red;" class="one" onclick="this.style.display='none'">
						    验证失败：
						      <ul>
						        <li>{{$errors}}</li>
						      </ul>
						  </div>
						@endif
						@if(session('success'))
						<div style="color:green;" class="one" onclick="this.style.display='none'">
						      <ul>
						        <li>{{ session('success')}}</li>
						      </ul>
						  </div>
						@endif
		<ul>
			<li>
				<i class="i-safety-lock"></i>
				<div class="m-left">
					<div class="fore1">登录密码</div>
					<div class="fore2"><small>为保证您购物安全，建议您定期更改密码以保护账户安全。</small></div>
				</div>
				<div class="fore3">
					<a href="/home/userinfo/editpass">
						<div class="am-btn am-btn-secondary">修改</div>
					</a>
				</div>
			</li>
			<li>
				<i class="i-safety-iphone"></i>
				<div class="m-left">
					<div class="fore1">手机验证</div>
					<div class="fore2"><small>{{$user->uphone ? "您已绑定手机，无需重复绑定":"您未绑定手机，请绑定手机"}}</small></div>
				</div>
				<div class="fore3">
						@if($user->uphone)
							<button class="am-btn am-btn-secondary" disabled>绑定</button>
						@else
							<a href="/home/userinfo/editphone"><button class="am-btn am-btn-secondary">绑定</button></a>
						@endif
				</div>
			</li>
			<li>
				<i class="i-safety-mail"></i>
				<div class="m-left">
					<div class="fore1">邮箱验证</div>
					<div class="fore2"><small>{{$user->uemail ? "您已绑定邮箱，无需重复绑定":"您未绑定邮箱，请绑定手机"}}</small></div>
				</div>
				<div class="fore3">
					@if($user->uemail)
						<button class="am-btn am-btn-secondary" disabled>绑定</button>
					@else
						<a href="/home/userinfo/editemail"><button class="am-btn am-btn-secondary">绑定</button></a>
					@endif
				</div>
			</li>
		</ul>
	</div>

</div>
@endsection